package io.renren.modules.app.controller;

import io.renren.common.utils.PageData;
import io.renren.common.utils.R;
import io.renren.modules.carlunbo.service.CarLunboService;
import io.renren.modules.carlunbo.vo.CarLunboVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 首页轮播图
 *
 */
@Api(tags = "首页轮播图")
@RestController
@RequestMapping("/app")
public class AppLunboController {
    @Autowired
    private CarLunboService carLunboService;

    @ApiOperation("轮播图展示")
    @GetMapping("/lunbolist")
    public R list(@RequestParam Map<String, Object> params){
        params.put("state",1);
        PageData<CarLunboVO> pageData = carLunboService.getLunboList(params);
        return R.ok().put("page", pageData);
    }
}
